from flask import Flask, request
import json
import os

app = Flask(__name__)
app.debug = True

@app.route('/')
def index():
    return "Hello Flask"

@app.route('/boot', methods=["POST"])
def boot():
    rtsp_list = request.get_json()
    rtps_str = json.dumps(rtsp_list)
    print(rtps_str)
    with open("/etc/demo.txt", 'w') as demo_txt:
        demo_txt.write(rtps_str);
    return "ok"

@app.route('/stop', methods=["POST"])
def stop():
    return "Hi Flask"

if __name__ == '__main__':
    app.run()
